Readme
Replication Package for "Scalable Demand and Markups"
Date: 05/20/2025


Code Structure:

Replication.do generates all Tables and Figures reported in the paper.  The code is structured in 8 parts, an outline of which is provided at the top of the do file.  The code takes the raw Nielsen scanner and consumer panel data as inputs, which is not provided in this package.  Access to the Nielsen datasets was obtained from the Kilts Center at the University of Chicago Booth School of Business, further information on purchasing this data is available at https://www.chicagobooth.edu/research/kilts/research-data/nielseniq.  The code also relies on two supplementary datasets which are supplied with this package:

- brand_lookup.dta : a mapping of products in Nielsen to their parent companies (manually generated by the authors)
- cpi_quarterly.dta : measure of cpi index to deflate prices

Replication.do also executes two python scripts, which generate marginal costs from observed prices and shares using the PyBLP package (Conlon and Gortmaker, 2020) 

- computing_costs.py 
- counter.py (used for counterfactuals)

Replication.do also relies on the external packages _gwtmean, ivreghdfe, and grc1leg, which are installed in part 1 of the script.

The Stata code creates the requisite file structure.  Researchers should put the supplementary data and python scripts in the folder $data_dir/supplemental.  Researchers may need to adjust the code to properly import the raw Nielsen files depending on their local file structure.

The Stata code was run using StataNow/MP 18.5 for Unix (Linux 64-bit x86-64)
The python code uses version 1.1.0 of PyBLP, version 0.2.0 of PyHDFE (Gortmaker and Tarascina), version 1.26.4 of numpy, and version 2.2.2 of pandas

